<extend name = "Common/baseView"/>
 <block name="css">
 	<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
 	<style type="text/css">
 		.containe{ width:990px;margin:100px auto;}
 		.table{text-align:center;margin-top: 20px;}
 		.table thead{background: #f2f2f2;font-size: 16px;}
 		.table td{height: 30px}
 		.btn{background: #009688;height: 25px;line-height: 10px;width: 40px;text-indent: -0.5em;color: #fff;margin-left: 5px}
 		.form{font-size: 14px;font-weight: 600;}
 		.form span{margin-left: 10px;}
 		.form input{width: 100px; }
        select{width: 100px;height: 25px;}
 		.form .btn{width:45px;margin-left: 10px;text-indent: -0.3em}
		a:hover{
			text-decoration: none;
		}
 	</style>
 </block>
<block name="body">
    <div class="containe">
    	<form action="userOrders" method="post" class="form">
    		<span>用户名：</span><input type="text" name="user">
    		<span>订单号：</span><input type="text" name="order">
    		<span>订单状态：</span><!-- <input type="text" name="order_sta"> -->
    		<select name="order_sta">
    			<option>请选择</option>
    			<option>未支付</option>
    			<option>已支付</option>
    			<option>退货</option>
    		</select>
    		<span>物流状态：</span>
    		<select name="sta">
    			<option>请选择</option>
    			<option>未派送</option>
    			<option>派送中</option>
    			<option>已送达</option>
    		</select>
    		<input type="submit" value="搜索" class="btn">
    	</form>
     <table class="table table-bordered">
     	<thead>
     		<tr>
     			<td>用户ID</td>
     			<td>用户名</td>
     			<td>订单号</td>
     			<td>商品数量</td>
     			<td>总价格</td>
     			<td>配送方式</td>
     			<td>订单状态</td>
     			<td>物流状态</td>
                <td>物流单号</td>
     			<td>创建时间</td>
     			<td>操作</td>
     		</tr>
     	</thead>
     	<tbody>
     		<foreach name="orders" item="value" key="key">
     		<tr>
     			<td>{$value.user_id}</td>
     			<td>{$value.user.name}</td>
     			<td>{$value.order_no}</td>
     			<td>{$value.order_sum}</td>
     			<td>{$value.order_price}</td>
     			<td>{$value.send_type}</td>
     			<?php 
     			   if($value['status']==0)
     			        $sta1='未支付';
     			   elseif($value['status']==1)
     			         $sta1='已支付'; 
     			       else  $sta1='退货';
                ?>
     			<td>{$sta1}</td>
     			
                <?php 
                  if($value['son']['status']==0)
     			      $sta2='未派送';
     			  elseif($value['son']['status']==1)  
     			      $sta2='派送中'; 
     			 else $sta2='已送达';
     			 ?>
     			<td>{$sta2}</td>
                <td>{$value.logistics_no}</td>
     			<td>{$value.create_time}</td>
     			<td>
     				<a class="btn" href="{:U(userOrderItem)}?a={$value.order_no}">查看</a>
     				<a class="btn" href="{:U(editOrder)}?a={$value.order_no}">修改</a>
                    <a class="btn delete" href="{:U(delete)}?a={$value.son.order_id}" >删除</a>
     			</td>
     		</tr>
           </foreach>
     	</tbody>
     </table>
  </div>
</block>
<block name="js">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript">
     $('.delete').click(function(){
          var msg = "您真的确定要删除吗？\n\n请确认！"; 
      if (confirm(msg)==true){ 
           return true; 
      }else{ 
         return false; 
         } 

     });
	 $('#orderlist').addClass("layui-this");
	 $('#user').addClass("layui-nav-itemed");
</script>
</block>